//全局混入

import Vue from 'vue'

import { Area } from 'vant';

Vue.use(Area);
import { reg } from './validate' //正则
import {mapActions, mapMutations, mapState } from 'vuex'
import {ShowSuccess,ShowLoading,ShowFail} from '@/api/request'
//本地
// export const ftList = [
//     { path:'/king',name:'king', text:"会员购",icon:"icon-shangpin"},
//     { path:'/shop',name:'shop', text:"分类",icon:"icon-gengduo" },
//     { path:'/cart',name:'cart', text:"购物车",icon:"icon-shangcheng",hot:true},
//     { path:'/mine',name:'mine', text:"我的",icon:"icon-wode1"},
// ]
//Van
export const ftList = [
    { path:'/king',name:'king', text:"会员购",icon:"goods-collect-o"},
    { path:'/shop',name:'shop', text:"分类",icon:"qr" },
    { path:'/cart',name:'cart', text:"购物车",icon:"shopping-cart-o",hot:true},
    { path:'/mine',name:'mine', text:"我的",icon:"user-o"},
]
Vue.mixin({
    data(){
       return{
        top:"星期天",
        ftList,
        reg,
        dpr:Math.floor(window.devicePixelRatio),
       }
    },
    computed:{
        ...mapState(['userInfo','myCarts',]),

    },
    methods:{
        ...mapMutations([
            'changeUserInfo',
            'changeMyCarts'

        ]),
        ...mapActions([
            'getMyCarts',
            'getAllGoods',
        ]),
        gotowhere(option){
           this.$router.push(option)
        },
        gotoback(){
            this.$router.go(-1)
        },
        ShowSuccess,
        ShowLoading,
        ShowFail,
    },
    mounted(){
        // console.log("测试全局混入");
    }
})